package com.test.java;

import java.util.Scanner;

/**
 * 本类实现的功能写在此处
 * =============================================================
 * Version          Author          Date            Description
 * 1.0              白建         2017/12/29             创建
 * =============================================================
 */
public class Java_30
{

    public static void main(String[] args)
    {

        Scanner scanner = new Scanner(System.in);
        String input = scanner.nextLine();
        String wanted = scanner.nextLine();

        StringBuilder strBuilder = new StringBuilder(input);
        int j, less = 0;
        for (int i = 0; i < wanted.length(); i++)
        {
            for (j = 0; j < strBuilder.length(); j++)
            {
                if (strBuilder.charAt(j) == wanted.charAt(i))
                {
                    strBuilder.setCharAt(j, '-');
                    break;
                }
            }
            if (j == strBuilder.length())
            {
                less++;
            }
        }
        if (less == 0)
        {
            System.out.println("Yes " + (strBuilder.length() - wanted.length()));
        }
        else
        {
            System.out.println("No " + less);
        }
    }
}
